#include "SMPPQuerySMResp.hpp"

using namespace smpp::pdu;

QuerySMResp::QuerySMResp(const Header &nHeader,
CoctetString nMessageId,
CoctetString nFinalDate,
quint8 nMessageState,
quint8 nErrorCode):
Header(nHeader),
_MessageId(nMessageId),
_FinalDate(nFinalDate),
_MessageState(nMessageState),
_ErrorCode(nErrorCode){}

QuerySMResp::QuerySMResp(const QuerySMResp &nQuerySMResp):
Header(nQuerySMResp),
_MessageId(nQuerySMResp.getMessageId()),
_FinalDate(nQuerySMResp.getFinalDate()),
_MessageState(nQuerySMResp.getMessageState()),
_ErrorCode(nQuerySMResp.getErrorCode()){}

void QuerySMResp::setMessageId(const CoctetString &nMessageId){
	_MessageId = nMessageId;
}

const CoctetString &QuerySMResp::getMessageId() const{
	return _MessageId;
}

void QuerySMResp::setFinalDate(const CoctetString &nFinalDate){
	_FinalDate = nFinalDate;
}

const CoctetString &QuerySMResp::getFinalDate() const{
	return _FinalDate;
}

void QuerySMResp::setMessageState(const quint8 nMessageState){
	_MessageState = nMessageState;
}

const quint8 QuerySMResp::getMessageState() const{
	return _MessageState;
}

void QuerySMResp::setErrorCode(const quint8 nErrorCode){
	_ErrorCode = nErrorCode;
}

const quint8 QuerySMResp::getErrorCode() const{
	return _ErrorCode;
}

void QuerySMResp::calcCommandLength(){
	_SequenceNumber = 18 + _MessageId.size() + _FinalDate.size();
}
